/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package info.touret.winecellar.reminder;

import org.apache.log4j.Logger;

import com.google.gdata.client.calendar.CalendarService;

/**
 * 
 * @author touret-a
 */
public class LocalCalendarServiceFactory implements CalendarServiceFactory {

	private static final Logger trace = Logger
			.getLogger(LocalCalendarServiceFactory.class);

	@Override
	public CalendarService get() {
		CalendarService myService = null;
		try {
				myService = new CalendarService(
					CalendarService.CALENDAR_SERVICE);

			myService.setUserCredentials(System.getProperty("gmail.username"),
					System.getProperty("gmail.userpwd"));
		} catch (Exception ex) {
			trace.error(ex.getMessage(), ex);
		}
		return myService;
	}
}
